from drg_group.yinchuan_2023.Base import message,intersect,SS_VALID
from drg_group.yinchuan_2023.DRG import MDCM_DRG

def group(record):
  adrg_zd=["A18.118+N51.1*","B26.000+N51.1*","D29.200","I86.101","N40.x00","N40.x01","N41.000","N41.100","N41.200","N41.300","N41.900x001","N42.101","N42.102","N42.300","N42.901","N43.100","N43.300","N43.301","N43.302","N44.x00","N44.x01","N45.002","N45.903","N45.904","N45.906","N45.907","N45.908","N47.x00x001","N47.x01","N47.x02","N47.x03","N48.001","N48.100","N48.102","N48.400x008","N48.801","N48.802","N48.901","N49.001","N49.101","N49.103","N49.201","N49.204","N49.205","N50.000","N50.100x001","N50.101","N50.803","N50.811","N50.815","N50.822","N50.827","N50.901","N50.903","Q53.100","Q53.101","Q53.102","Q53.200","Q53.202","Q53.901","Q53.902","Q54.001","Q54.100","Q54.200","Q54.800","Q54.900","Q55.004","Q55.202","Q55.602","Q55.603","Q55.604","Q55.606","Q55.801","S30.206","S30.208","S38.200x003","S39.900x007","S39.900x009"]
  adrg_zd1=[]
  adrg_ss=[]
  adrg_ss1=[]
  adrg_ss2=[]
  dept_list=[]
  if True and record.zdList[0] in adrg_zd:
    message('符合MS1入组条件，匹配规则：主诊断匹配')
    
    if MDCM_DRG.MS13_group(record):
      return 'MS13'

    if MDCM_DRG.MS15_group(record):
      return 'MS15'

    return 'MS1'
  else:
    return ''

